package com.service.xsxt;

import com.dao.xsxt.RoomShowMapper;
import com.entity.common.ApiResult;
import com.entity.xsxt.RoomShow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2019/3/6.
 */

@Service
public class RoomManageService {

    @Autowired
    private RoomShowMapper roomShowMapper;

   public ApiResult deleteByPrimaryKey(Integer id){
       roomShowMapper.deleteByPrimaryKey(id);
       return null;
    }

    public ApiResult insert(RoomShow record){
        roomShowMapper.insert(record);
        return null;
    }

    public ApiResult insertSelective(RoomShow record){
        roomShowMapper.insertSelective(record);
        return null;
    }

    public ApiResult selectByPrimaryKey(Integer id){
        roomShowMapper.selectByPrimaryKey(id);
        return null;
    }

    public ApiResult updateByPrimaryKeySelective(RoomShow record){
        int num =roomShowMapper.updateByPrimaryKeySelective(record);
        if(num>0){
            return new ApiResult(true,"更新成功!");
        }
        return new ApiResult(false,"更新失败！");
    }

    public ApiResult updateByPrimaryKey(RoomShow record){
        roomShowMapper.updateByPrimaryKey(record);
        return null;
    }

    public List<RoomShow> getPageList(String filter,String audit,String flag) {
        return roomShowMapper.getPageList(filter,audit,flag);
    }

    public ApiResult deleteData(int id) {
       int num= roomShowMapper.deleteByPrimaryKey(id);
       if(num>0){
           return new ApiResult(true,"删除成功!");
       }
       return new ApiResult(true,"删除失败!");
    }
}

